/**
 * Custom tabel model to display memory correctly.
 */

package memsim;
import javax.swing.table.DefaultTableModel;
import java.util.Vector;

public class MemoryTableModel extends DefaultTableModel{

    /**
     * The constructor which accpets and inputs array for the values. Also has
     * input for the names of the columns.
     *
     * @param data          the data to be displayed in the columns
     * @param columnNames   the names of each column
     */
    public MemoryTableModel(Object[][] data, String[] columnNames )
    {
        super(data, columnNames);
    }

    /**
     * The constructor which accpets and inputs vectors for values. Also uses a
     * second vector for the column names.
     * 
     * @param data          the data to be displayed in the columns
     * @param columnNames   the names of each column
     */
    public MemoryTableModel(Vector data, Vector columnNames)
    {
        super(data, columnNames);
    }
    
    @Override
    public boolean isCellEditable(int row, int column)
    {
        if(column == 0)
            return false;
        return true;
    }

}
